package app.base.testcase;

import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

public class Countdown extends HttpServlet { 

	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest req, HttpServletResponse res)
                               throws ServletException, IOException {
		req.setCharacterEncoding("utf-8");
	   

	    res.getWriter().write("###################### request.getQueryString() " + req.getParameter("msg"));		
		
	    return;
	    /*
    ServletOutputStream out = res.getOutputStream();  // some binary output

    // Prepare a multipart response
    MultipartResponse multi = new MultipartResponse(res);

    // First send a countdown
    for (int i = 6000; i > 0; i--) { 
      multi.startResponse("text/html");
      out.println(i + "...");
      out.println("<script>alert(\"testing..." + i + "\");</script>");
      multi.endResponse();
      try { Thread.sleep(6000); } catch (InterruptedException e) { }
    }

    // Then send the launch image
    multi.startResponse("text/plain");
    
    out.println("##########################");

    // Don't forget to end the multipart response
    multi.finish();*/
  }
	
	public void doPost(HttpServletRequest req, HttpServletResponse res)
	throws ServletException, IOException {
		doGet(req, res);
	}
	
}